<!DOCTYPE html>
<html>

<head>
  <link rel='stylesheet' href='/stylesheets/style.css' />
  <link rel="stylesheet" href="/stylesheets/common.css">
</head>

<body>
  <!-- <% %> 里面写JS， -->
  <ul>
    <% for(var i=0; i < userList.length; i++) {%>
      <li>
        <%=userList[i]["userName"] %>
      </li>
      <% } %>
  </ul>
  <img src="/images/bg.jpg">
</body>
<script>
  fetch("http://localhost:3000/test?userid=10&age=20").then(res => {
    return res.text();
  }).then(res => {
    console.log(res)
  })

  fetch("http://localhost:3000/show/1").then(res => {
    return res.text()
  }).then(res => {
    console.log(res)
  })

  var obj = { username: "zhangsan", pwd: "12345" }
  fetch("http://localhost:3000/login", {
    body: JSON.stringify(obj),
    method: "POST"
  }).then(res=>{
    return res.json()
  }).then(res=>{
    console.log(res)
  })

</script>

</html>